<script src="../js/equal.js"></script>
<script>
  // 1
  {
    const [all, last] = [[1, 2, 3, 4]];
    console.assert(equal(all, [1, 2, 3, 4]), `1. 不成立`);
  }
  // 2
  {
    const [, ...all] = [1, 2, 3, 4];
    console.assert(equal(all, [2, 3, 4]), `2. 不成立`);
  }
  // 3
  {
    const theEnd = [3, 4];
    const allInOne = [1, 2, ...theEnd];
    console.assert(equal(allInOne, [1, 2, 3, 4]), `3. 不成立`);
  }
  // 4
  {
    const [...theDate] = [2015, 1, 1];
    const date = new Date(...theDate);
    console.assert(equal(date, new Date(2015, 1, 1)), `4. 不成立`);
  }
</script>